<?php /* Smarty version Smarty-3.1.21-dev, created on 2018-03-06 21:59:37
         compiled from "/data/wwwroot/61kq.com/uploads/app/template/wap/askhotweek.htm" */ ?>
<?php /*%%SmartyHeaderCode:2560456995a9e9ec9911d70-75098451%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '1462a68b53b93c6b820b25a7504484652fc26add' => 
    array (
      0 => '/data/wwwroot/61kq.com/uploads/app/template/wap/askhotweek.htm',
      1 => 1515035026,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2560456995a9e9ec9911d70-75098451',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'list' => 0,
    'my_atten' => 0,
    'uid' => 0,
    'total' => 0,
    'pagenav' => 0,
    'config' => 0,
    'wap_style' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.21-dev',
  'unifunc' => 'content_5a9e9ec99c58b7_02731732',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5a9e9ec99c58b7_02731732')) {function content_5a9e9ec99c58b7_02731732($_smarty_tpl) {?><?php if (!is_callable('smarty_function_url')) include '/data/wwwroot/61kq.com/uploads/app/include/libs/plugins/function.url.php';
if (!is_callable('smarty_modifier_date_format')) include '/data/wwwroot/61kq.com/uploads/app/include/libs/plugins/modifier.date_format.php';
?><?php global $db,$db_config,$config;eval('$paramer=array("hot"=>"7","order"=>"\'answernum\'","item"=>"\'list\'","ispage"=>"1","t_len"=>"20","limit"=>"10","nocache"=>"")
;');$list=array();
		$ParamerArr = GetSmarty($paramer,$_GET,$_smarty_tpl);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
        global $ModuleName;
        if(!$Purl["m"]){
            $Purl["m"]=$ModuleName;
        }
         
        if($paramer[state]){
           $where=1;
        }else{
           $where = "`state`=1 ";
        }
		
		
		if($_COOKIE['uid']&&$paramer['friend']){
			$atn=$db->select_all("atn","`uid`='".$_COOKIE['uid']."'","`sc_uid`");
			$friend=array();
			foreach($atn as $val){
				$friend[]=$val['sc_uid'];
			}
			$where.=" and `id` in(".@implode(',',$friend).")";
			unset($friend);
		} 
		if($paramer[hot]){
			$time=strtotime("-".(int)$paramer[hot]." day");
			$where.=" and `add_time`>'".$time."'";
		}
		if($paramer[noid]){
			$where.=" and `id`<>'".$paramer[noid]."'";
		}
		if($paramer[keyword]){
			$where.=" and `title` like '%".$paramer['keyword']."%'";
		}
		if($paramer[nonum]){
			$where.=" and `answer_num`='0'";
		}
		if($paramer[yesnum]){
			$where.=" and `answer_num`>0";
		}
		
		if($paramer[order]){ 
			if($paramer[order]=="addtime"){
				$paramer[order]="add_time";
			}
			if($paramer[order]=="answernum"){
				$paramer[order]="answer_num";
			}
			$order = " ORDER BY `".$paramer[order]."`  desc";
		}else{
			$order = " ORDER BY `add_time` desc";
		}
		if($paramer[cid]){
			$where .=" and `cid`='".$paramer[cid]."'";
		}
		if($paramer[uid]){
			$where .=" and `uid`='".$paramer[uid]."'";
		}
		if($paramer[is_recom]){
			$where .=" and `is_recom`='1'";
		}
		
		
		if($paramer[limit]){
			$limit=" limit ".$paramer[limit];
		}
		
		if($paramer['ispage']){
			$limit = PageNav($paramer,$_GET,"question",$where,$Purl,"","6",$_smarty_tpl);
		}
		$list = $db->select_all("question",$where.$order.$limit);  
		if(count($list)){
			foreach($list as $key=>$val){
				if(intval($paramer[t_len])>0){
					$len = intval($paramer[t_len]);
					$list[$key][title]  = mb_substr($val[title],0,$len,"utf-8");
				}
				if($paramer['keyword']){ 
					$list[$key][title] =str_replace($paramer[keyword],"<font color='#FF6600' >".$paramer[keyword]."</font>",$list[$key][title]);
				}
				if($val['pic']&&file_exists(str_replace($config['sy_weburl'],APP_PATH,".".$val['pic']))){
					$list[$key]['pic']=$config["sy_weburl"]."/".$val['pic'];
				}else{
					$list[$key]['pic']=$config["sy_weburl"]."/".$config['sy_friend_icon'];
				}
				
				$list[$key][url] = Url("ask",array("c"=>"content","id"=>$val[id]));
				$list[$key][userurl] = Url("ask",array("c"=>"friend","a"=>"myquestion","uid"=>$val[uid]));
				if(in_array($val[uid],$ListId)==false){$ListId[] =  $val[uid];} 
				$Qclass[]=$val[cid];
			}
			
			$uids=@implode(",",$ListId);
			$_GET["total"]=1;  
			foreach($list as $r_k=>$r_v){
				if($r_v['uid']==$_COOKIE['uid']){
					$list[$r_k]['isatn']='2';
				} 
			}	
		} ?>
 <?php echo $_smarty_tpl->getSubTemplate (((string)$_smarty_tpl->tpl_vars['wapstyle']->value)."/header_cont.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 
<?php  $_smarty_tpl->tpl_vars['list'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['list']->_loop = false;
$list = $list; if (!is_array($list) && !is_object($list)) { settype($list, 'array');}
foreach ($list as $_smarty_tpl->tpl_vars['list']->key => $_smarty_tpl->tpl_vars['list']->value) {
$_smarty_tpl->tpl_vars['list']->_loop = true;
?>
<div class="ask_ct_list" style="margin-top:10px;">
  <div class="ask_ct_list_tit">
    <div class="ask_ct_list_tit_ft"><a href="<?php echo smarty_function_url(array('m'=>'wap','c'=>'ask','a'=>'content','id'=>'`$list.id`'),$_smarty_tpl);?>
"><?php echo mb_substr($_smarty_tpl->tpl_vars['list']->value['title'],0,12,"utf-8");?>
</a></div>
    <?php if ($_smarty_tpl->tpl_vars['list']->value['isatn']!='2') {?>
    <div class="ask_ct_list_tit_rt">
      <?php if (in_array($_smarty_tpl->tpl_vars['list']->value['id'],$_smarty_tpl->tpl_vars['my_atten']->value)) {?> <a href="javascript:void(0);" class="watch_qxgz" onclick="attention('<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
','1','<?php echo smarty_function_url(array('m'=>'wap','c'=>'ask','a'=>'attention'),$_smarty_tpl);?>
');" >取消关注</a> <?php } else { ?>
      <?php if ($_smarty_tpl->tpl_vars['uid']->value) {?> <a href="javascript:void(0);" class="watch_gz" onclick="attention('<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
','1','<?php echo smarty_function_url(array('m'=>'wap','c'=>'ask','a'=>'attention'),$_smarty_tpl);?>
');">关注</a> <?php } else { ?> <a href="javascript:void(0)"  onclick="showlogins('1');" class='watch_gz'>关注</a> <?php }?>
      <?php }?> 
      </div>
      <?php }?>
  </div>
  <div class="ask_ct_list_peo">
    <dl>
      <dt><img style="width:64px;height:80px;" src="<?php echo $_smarty_tpl->tpl_vars['list']->value['pic'];?>
" /></dt>
      <dd><?php echo mb_substr(preg_replace('!<[^>]*?>!', ' ', $_smarty_tpl->tpl_vars['list']->value['content']),0,36,'utf-8');?>
</dd>
      <dd><a href="<?php echo smarty_function_url(array('m'=>'wap','c'=>'ask','a'=>'myquestion','uid'=>'`$list.uid`'),$_smarty_tpl);?>
"><i><?php echo mb_substr($_smarty_tpl->tpl_vars['list']->value['nickname'],0,8,'utf-8');?>
</i></a> 发起了话题</dd>
      <dd class="ask_ct_list_peo_js"><?php echo $_smarty_tpl->tpl_vars['list']->value['atnnum'];?>
 人关注 · <?php echo $_smarty_tpl->tpl_vars['list']->value['answer_num'];?>
 个回答 · <?php echo $_smarty_tpl->tpl_vars['list']->value['visit'];?>
次浏览</dd>
      <dd><em><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['list']->value['add_time'],"%Y-%m-%d %H:%M");?>
</em></dd>
    </dl>
  </div>
</div>
<?php } ?>  
<div class="clear"></div>
<?php if ($_smarty_tpl->tpl_vars['total']->value==0) {?>

<div class="noresult png" >您还没有任何问题，抓紧提问吧！</div>
<?php } else { ?> 
<div class="pages"><?php echo $_smarty_tpl->tpl_vars['pagenav']->value;?>
</div>
<?php }?>     
<?php echo '<script'; ?>
 src="<?php echo $_smarty_tpl->tpl_vars['config']->value['sy_weburl'];?>
/js/jquery-1.8.0.min.js?v=<?php echo $_smarty_tpl->tpl_vars['config']->value['cachecode'];?>
" language="javascript"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
 src="<?php echo $_smarty_tpl->tpl_vars['wap_style']->value;?>
/js/layer/layer.m.js?v=<?php echo $_smarty_tpl->tpl_vars['config']->value['cachecode'];?>
" language="javascript"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
 src="<?php echo $_smarty_tpl->tpl_vars['wap_style']->value;?>
/js/public.js?v=<?php echo $_smarty_tpl->tpl_vars['config']->value['cachecode'];?>
" language="javascript"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
 src="<?php echo $_smarty_tpl->tpl_vars['wap_style']->value;?>
/js/prefixfree.min.js?v=<?php echo $_smarty_tpl->tpl_vars['config']->value['cachecode'];?>
" language="javascript"><?php echo '</script'; ?>
>
<?php echo $_smarty_tpl->getSubTemplate (((string)$_smarty_tpl->tpl_vars['wapstyle']->value)."/footer.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<?php }} ?>
